package com.ruoyi.merchant.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.merchant.api.domain.Merchant;
import com.ruoyi.merchant.api.domain.MerchantImgs;
import com.ruoyi.merchant.api.domain.MerchantVerification;
import com.ruoyi.merchant.api.factory.RemoteMerchantFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @name: RemoteMerchantService
 * @author: zhangzhimin
 * @date: 2025-05-10 15:25
 **/
@FeignClient(contextId = "remoteMerchantService", value = ServiceNameConstants.MERCHANT_SERVICE, fallbackFactory = RemoteMerchantFactory.class)
public interface RemoteMerchantService {
    @PostMapping("/merchant/merchantlist")
    public TableDataInfo merchantlist(@RequestBody Merchant merchant, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/verification/getMerchantByPhone")
    public MerchantVerification getMerchantByPhone(@RequestParam("phone") String phone, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/merchant/merchantAdd")
    public AjaxResult merchantAdd(@RequestBody Merchant merchant, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    @PostMapping("/verification/MerchantVerificationAdd")
    public AjaxResult MerchantVerificationAdd(@RequestBody MerchantVerification merchantVerification, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("addimgs")
    public AjaxResult addimgs(@RequestBody List<MerchantImgs> merchantImgs, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/verification/getlist")
    public    List<MerchantVerification> getlist(MerchantVerification merchantVerification, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
